package com.naihe.anderson.sms.entity;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

public class NhsmsSession implements Serializable, Comparable<NhsmsSession> {

	/**
	 * 
	 */
	private static final long serialVersionUID = 8676137391590383360L;
	
	/**
	 * 短消息会话序号
	 */
	public static final String _TID = "_tid";


	/**
	 * 发件人地址，手机号
	 */
	public static final String ADDRESS = "address";

	/**
	 * 发件人，返回一个数字就是联系人列表里的序号，陌生人为null
	 */
	public static final String PERSON = "person";

	/**
	 * 日期 long型，想得到具体日期自己转换吧！
	 */
	public static final String DATE = "date";

	/**
	 * 协议标识符代码,0 SMS_RPOTO, 1 MMS_PROTO
	 */
	public static final String PROTOCOL = "protocol";

	/**
	 * 是否阅读
	 */
	public static final String READ = "read";

	/**
	 * 短消息内容
	 */
	public static final String BODY = "body";
	
	/**
	 * 数据量
	 */
	public static final String NUM_SIZE = "size";

	/**
	 * 密码
	 */
	public static final String CIPHER = "cipher";
	/**
	 * 短信分页数
	 */
	public static final int PAGE_SIZE = 50;
	
	private long tid;
	private String address;
	private long person;
	private long date;
	private int protocol;
	private int read;
	private String body;
	private long numsize;
	private List<Nhsms> nhsms;
	private String cipher;
	
	public long getTid() {
		return tid;
	}
	public void setTid(long tid) {
		this.tid = tid;
	}
	public String getAddress() {
		return address;
	}
	public void setAddress(String address) {
		this.address = address;
	}
	public long getPerson() {
		return person;
	}
	public void setPerson(long person) {
		this.person = person;
	}
	public long getDate() {
		return date;
	}
	public void setDate(long date) {
		this.date = date;
	}
	public int getProtocol() {
		return protocol;
	}
	public void setProtocol(int protocol) {
		this.protocol = protocol;
	}
	public int getRead() {
		return read;
	}
	public void setRead(int read) {
		this.read = read;
	}
	public String getBody() {
		return body;
	}
	public void setBody(String body) {
		this.body = body;
	}
	public List<Nhsms> getNhsms() {
		if(nhsms == null) nhsms = new ArrayList<Nhsms>();
		return nhsms;
	}
	public void setNhsms(List<Nhsms> list) {
		if(nhsms == null) nhsms = new ArrayList<Nhsms>();
		nhsms.addAll(list);
	}
	public long getNumsize() {
		return numsize;
	}
	public void setNumsize(long numsize) {
		this.numsize = numsize;
	}

	@Override
	public int compareTo(NhsmsSession another) {
		if(another.getDate() > getDate())
			return 1;
		else
			return -1;
	}
	public String getCipher() {
		return cipher;
	}
	public void setCipher(String cipher) {
		this.cipher = cipher;
	}
}
